using System;
using System.Collections.Generic;
using System.Text;
using Entities;
using DAL;

namespace BUS
{
  public   class tbDienDenBUS
    {
        public static void Insert(tbDiemDen diemden)
        {
            tbDiemDenDAL diendenDAL = new tbDiemDenDAL();
            diendenDAL.Insert(diemden);

        }
        public static void Uptate(tbDiemDen  diemden)
        {
            tbDiemDenDAL diemdenDAL = new tbDiemDenDAL();
            diemdenDAL.Update(diemden);

        }
        public static void Delete(int iD)
        {
            tbDiemDenDAL diemdenDAL = new tbDiemDenDAL();
            diemdenDAL.Delete(iD);
        }
        public static tbDiemDenCollection Get(string where, int pageindex, int pagesize, string orderby, string orderdirection, out int total)
        {
            tbDiemDenDAL diemdenDAL = new tbDiemDenDAL();
            return diemdenDAL.Get(where, pageindex, pagesize, orderby, orderdirection, out total);
        }
        public static tbDiemDenCollection GetAll()
        {
            int total = 0;
            tbDiemDenDAL diemdenDAL = new tbDiemDenDAL();
            return diemdenDAL.Get("where 1=1", 0, 0,
            tbDiemDenColumns.MaDiemDen.ToString(),
            "ASC", out total);
        }
        public static tbDiemDen GetByID(int iD)
        {
            int total = 0;
            tbDiemDenDAL diemdenDAL = new tbDiemDenDAL();
            tbDiemDenCollection diemdenCollection = diemdenDAL.Get("where " +
            tbDiemDenColumns.MaDiemDen .ToString() + "=" + iD.ToString(),
            0, 0, tbDiemDenColumns.MaDiemDen.ToString(), "ASC", out total);
            if (diemdenCollection.Count > 0)
                return diemdenCollection[0];
            return null;
        }

    }
}
